.leaderboard {
  max-width: 1200px;
  padding: 1rem;
  margin: 0 auto;
  color: var(--text-primary);
}

.tableContainer {
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 10%),
    0 2px 4px -2px rgb(0 0 0 / 10%);
  -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */

  /* Hide scrollbar for Chrome, Safari and Opera */
  &::-webkit-scrollbar {
    display: none;
  }
}

.scrollHint {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.7;
  animation: fade-in 0.5s ease-in-out;

  span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 0.7;
    transform: translateX(0);
  }
}

.table {
  width: 100%;
  font-size: 0.95rem;
  border-collapse: collapse;

  th,
  td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  th {
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    background-color: var(--bg-color);
  }

  tr:last-child td {
    border-bottom: none;
  }
}

.userHeader {
  width: 30%;
  min-width: 200px;
  text-align: left;
}

.sortable {
  min-width: 80px;
  text-align: center !important;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: var(--bg-color);
  }

  &.active {
    color: var(--primary-color);
  }
}

.userRow {
  transition: background-color 0.2s ease;

  &:hover {
    background-color: var(--bg-color);
  }
}

.userCell {
  padding: 0.75rem 1rem !important;
}

.userLink {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;

  &:hover {
    color: var(--primary-color);
  }
}

.avatar {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  transition: border-color 0.2s ease;

  .userLink:hover & {
    border-color: var(--primary-color);
  }
}

.userName {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  white-space: nowrap;
}

.rank {
  width: 50px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.contributionCount {
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
}

.techCell {
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.techIcon {
  width: 24px;
  height: 24px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Responsive styles */
@media (width <= 768px) {
  .table {
    font-size: 0.9rem;

    th,
    td {
      padding: 0.75rem 0.5rem;
    }
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .userName {
    max-width: 120px;
  }

  .techIcon {
    width: 20px;
    height: 20px;
  }
}

@media (width <= 480px) {
  .leaderboard {
    padding: 0 1rem;
  }

  .table {
    font-size: 0.85rem;

    th,
    td {
      padding: 0.5rem 0.25rem;
    }
  }

  .userName {
    max-width: 100px;
  }
}
